package com.cos.openapi.dao;

import com.cos.openapi.entity.AdminUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

public interface AdminUserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AdminUser record);

    int insertSelective(AdminUser record);

    AdminUser selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AdminUser record);

    int updateByPrimaryKey(AdminUser record);

    /**
     * @author: COS
     * @return:
     * @time: 2021/1/29 9:16
     * @description: 使用邮箱查找用户
     */
    AdminUser getAdminUserByEmail(String email);
    /**
     *
     * @author: COS
     * @return:
     * @time: 2021/2/1 14:32
     * @description: 动态查询
     */
    List<AdminUser> table(@Param("realName") String realName, @Param("email") String email, @Param("status") Integer status);
    /**
     *
     * @author: COS
     * @return:
     * @time: 2021/2/1 14:47
     * @description: 批量删除
     */
    void del(@Param("ids") Integer[] ids);

    List<Integer> user_role(Integer userId);

    void delRole(@Param("userId") Integer userId);
    void delRoleByUserIds(@Param("userIds") Integer[] userIds);

    void addRole(@Param("userId") Integer userId,@Param("roleIds") Integer[] roleIds);
}